<?php
if(!isset($GLOBALS['_vars'])) $GLOBALS['_vars'] = array(); 
$fields = array();
?><!doctype html>
<html>
<head>
<meta charset="<?php echo $cfg_soft_lang; ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>商城订单 - 会员中心 - <?php echo $cfg_webname; ?></title>

<link href="/templets/nbbmobi/style/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="templets/style/base.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="templets/js/j.js"></script>
<script type="text/javascript" src="templets/js/load.js"></script>
<script type="text/javascript" src="templets/js/leftmenu.js"></script>
<script type="text/javascript" src="templets/js/table_function.js"></script>
<script type="text/javascript">
	//获得选中文件的文件名
	function GetCheckfolderItem()
	{
		var allSel='';
		if(document.form1.deleteid.value) return document.form1.deleteid.value;
		for(i=0;i<document.form1.deleteid.length;i++)
		{
			if(document.form1.deleteid[i].checked)
			{
				if(allSel=='')
				allSel=document.form1.deleteid[i].value;
				else
				allSel=allSel+","+document.form1.deleteid[i].value;
			}
		}
		return allSel;
	}
	
	function DoSubmit()
	{
		var selid = GetCheckfolderItem();
		if(selid=='') {
			alert("你没选中任何信息！");
			return false;
		}
		if(window.confirm("你确定要删除这些消息么？"))
		{
			location = "shops_orders.php?dopost=del&ids="+selid;
		}
	}
</script>
</head>
<body>
  <?php include(DEDEMEMBER."/templets/head.htm"); ?>
<div class="container-xl">
  <div class="row">

    <div class="col-12 bg-white">
      <div class="my-3">
		<a class="btn btn-primary btn-sm" href="mypay.php" id="buy">我购买的文章</a>
		<a class="btn btn-primary btn-sm" href="shops_orders.php">商品定单</a>
		<a class="btn btn-primary btn-sm" href="shops_products.php" id="buy">我购买的商品</a>
	 </div>
      <div id="mainCp">
        <!--内容消息提示 -->
        <h3 class="meTitle pb-3">商品订单</h3>
        <div class="postForm" style="padding-bottom: 0px;">
          <form name="form3" action="shops_products.php" method="get">
			<div class="input-group mb-3">
			  <div class="input-group-prepend">
				<span class="input-group-text">订单号</span>
			  </div>
			  <input name='oid' value='' type="text" class="form-control" aria-label="Amount (to the nearest dollar)">
			  <div class="input-group-append">
				<span class="input-group-text"><button class="button2" type="submit">搜索</button></span>
			  </div>
			</div>
		  
          </form>
        </div>
        <div class="table-responsive">
        <table class="table table-hover">
            <thead class="thead-light">
              <tr>
                <th>订单号</th>
                <th>状态 </th>
                <th>数量 </th>
                <th>总计(元)</th>
                <th>时间 </th>
              </tr>
            </thead>
            <form name='form1' action="shops_orders.php" method="post">
            <input type='hidden' name='dopost' value='del' />
            <tbody>
            <?php
$atts = array();
$atts['tagname'] = 'datalist';
$blockValue = $this->refObj->GetArcList($atts,$this->refObj,$fields); 
if(is_array($blockValue)){
foreach( $blockValue as $key=>$fields )
{
?>
            <tr>
              <td><input type="checkbox" name="deleteid" value="<?php echo $fields['oid']; ?>"/><a class="ml-3" href="shops_products.php?do=show&oid=<?php echo $fields['oid']; ?>"><?php echo $fields['oid']; ?></a></td>
              <td><?php echo GetSta($fields["state"],$fields["oid"])?></td>
              <td><?php echo $fields['cartcount']; ?></td>
              <td ><strong><?php echo $fields['priceCount']; ?></strong></td>
              <td><?php echo Mydate('Y-m-d h:i:s',$fields['stime']); ?></td>
            </tr>
            <?php
}
}?>
            <tr>
            <td colspan="5"><button id="checkedClick" type="button" class="greenBtn1">全选</button><button type="button" onclick="DoSubmit()" class="greenBtn3">删除选中</button></td></tr></tbody>
            </form>
          <tfoot>
            <tr>
              <td colspan="5"><span class="d-md-none text-secondary">手机上可按住订单向左拖动查看全部</span><div class="pageList"><?php
$atts = array();
$atts['tagname'] = 'pagelist';
$atts['listitem'] = 'info,index,end,pre,next,pageno';
$atts['listsize'] = '5';
 echo $this->refObj->GetPageList($atts,$this->refObj,$fields); 
?>
</td>
            </tr>
          </tfoot>
        </table>
      </div>
      </div>
      <!--主操作区域 -->
    </div>
  </div>
</div>
<?php include(DEDEMEMBER."/templets/foot.htm"); ?>

</body>
</html>